package demo06;

import java.lang.reflect.Method;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * 6. 提示用户录入他的出生年月日, 计算这个用户一共活了多少天, 并将结果打印到控制台上.
 */
public class demo06 {
    public static void main(String[] args) throws ParseException {
        System.out.println("提示用户录入的出生年月日格式按1980-01-01");
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
/*        String[] strings = s.split("-");
        int year = Integer.parseInt(strings[0]);
        int month = Integer.parseInt(strings[1])-1;
        int day = Integer.parseInt(strings[2]);*/
        Date nowdate = new Date();
        long nowdateTime = nowdate.getTime();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date lastdate = simpleDateFormat.parse(s);
        long lastdateTime = lastdate.getTime();
        System.out.println((nowdateTime - lastdateTime) / (1000 * 24 * 60 * 60));
        Boolean b = null;
        System.out.println(b);
        Integer integer = null;
        System.out.println(integer);
        ;
    }
}
